<!DOCTYPE html>
<html>

<head>

    {include file="Public/header"}
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
</head>

<body style="color:#333;padding:3px;" class="x_sorll">
<!-- 标题 -->
<div class="page-heade">
    <h2 class="title_color text-center">TI费用{:db('cg_ti_cate')->where('id',$data.cate_id)->value('title')}</h2>
</div>
<!-- 标题 -->
<div class="form-inline">
    <form action="">
        <table class="tab-content table-bordered table" border="1">
            <tr>
                <td>
                    <a class="btn-info btn" style="margin-right: 15px" href="?export=1">导出Excel完整版</a>
                    <button class="btn btn-info">导出Excel打印版</button>
                </td>
            </tr>
        </table>

        <table class="table row-margin-top table-bordered bud_hei">
            {if $data.yhx||$data.fb==1}
            <tr class="warning">
                <th colspan="8">
                    {if $data.yhx}
                    <label for="" class="form-label font-bold"  style="margin-left: 15px">当前的销售费用核销:</label>
                    {volist name="hxsn" id="row"}
                    <a href="{:url('tihexiao/view',['id'=>$row.id])}" class="J_menuItem">{$row.sn}</a>
                    {/volist}
                    {/if}
                    {if $data.fb==1}
                    <label for="" class="form-label font-bold" style="margin-left: 15px">反馈表:</label>
                    <a href="{:url('tifeedback/view',['id'=>$fbsn.id])}" class="J_menuItem">{$fbsn.no}</a>
                    {/if}
                </th>
            </tr>
            {/if}
            <tr>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">主题</label></td>
                <td colspan="3" class="font-bold">{$data.title}</td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">类型</label></td>
                <td>{$data.arealat==1?'经销商类':'网点类'}</td>
            </tr>
            <tr>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">分区</label></td>
                <td>{$data.zoning}</td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">省份</label></td>
                <td>{$data.provice}</td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">城市</label></td>
                <td>{$data.city}</td>
            </tr>
            <tr>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">申请人</label></td>
                <td><a href="javascript:;">{$data.cusername}</a></td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">职位</label></td>
                <td>{$data.job}</td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">状态</label></td>
                <td>{$data.status_title}{if $data.status2==2}/取消{else}/异动{/if}</td>
            </tr>
            <tr>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">经销商名称</label></td>
                <td colspan="3"><span class="font-bold">{$data.jxs_title} <a href="{:url('Commonti/jxsyj')}?aid={$data.id}" class="J_menuItem"><span style="display: none;">经销商决策信息</span><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true"></span></a></span></td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">性质</label></td>
                <td>经销</td>
            </tr>
            <tr>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">编号</label></td>
                <td>{$data.sn}</td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">原编号</label></td>
                <td>
                    {if $data.old}
                    <a href="{:url('view',['id'=>$data.old])}">{:db('cg_ti')->where('id',$data.old)->value('sn')}</a>
                    {else}
                    无
                    {/if}</td>
                <td style="min-width: 120px;width: 120px"><label for="" class="form-label">{if $data.status2==2}取消{else}异动{/if}后编号</label></td>
                <td>
                    {if $data.new}
                    <a href="{:url('view',['id'=>$data.new])}">{:db('cg_ti')->where('id',$data.new)->value('sn')}</a>
                    {else}
                    无
                    {/if}
                </td>
            </tr>
            <tr>
                <td colspan="6" class="text-left">{$data.brief}
                </td>
            </tr>
        </table>
        <table class="table row-margin-top table-bordered text-center bud_hei">
            <thead>
                <tr>
                    <th class="font-bold text-center" style="font-size:16px" colspan="33">费用规划内容(金额单位：元)</th>
                </tr>
                <tr class="info">
                    <th class="text-center">状态</th>
                    <th class="text-center">审批人</th>
                    <th class="text-center">核查结果</th>
                    <th class="text-center">序号</th>
                    <th class="text-center">明细编号</th>
                    <th class="text-center">{$data.arealat_title}</th>
                    <th class="text-center">活动执行时间</th>
                    <th class="text-center">异动活动执行时间</th>
                    <th class="text-center">预计核销时间</th>
                    <th class="text-center">{$data.product_title}</th>
                    <th class="text-center">三级费用科目</th>
                    <th class="text-center">费用支付方式</th>
                    <th class="text-center">未税费用金额<br>(申请金额/批复金额/反馈金额)</th>
                    <th class="text-center">是否增值税(可抵扣)</th>
                    <th class="text-center">税率</th>
                    <th class="text-center">含税费用金额(元)</th>
                    <th class="text-center">实际投入费用(元)</th>
                    <th class="text-center">已核销金额(元)</th>
                    <th class="text-center">预计销量</th>
                    <th class="text-center">预计费用率</th>
                    <th class="text-center">实际销量</th>
                    <th class="text-center">销售达成率</th>
                    <th class="text-center">2SR基准销量</th>
                    <th class="text-center">基准销量</th>
                    <th class="text-center">预计ROI</th>
                    <th class="text-center">备注</th>
                    <th class="text-center">异动原因</th>
                    <th class="text-center">取消原因</th>
                    <th class="text-center">费用计入部门</th>
                    <th class="text-center">计入部门修改人</th>
                    <th class="text-center">费用计入方案</th>
                    <th class="text-center">计入方案修改人</th>
                    <th class="text-center">收款方</th>
                </tr>
            </thead>
            <tbody>

                <?php $index = 0; ?>
                {volist name="data.list" id="rr" key="k"}
                {volist name="rr._child" id="row"}
                <?php $index ++; ?>
                <tr {if $row.status==1}style="color:green;"{/if}>
                    <td>{if $row.status==0}正常{elseif $row.status==1}<font color="green">异动</font>{elseif $row.status==2}<font color="red">取消</font>{/if}</td>
                    <td>{$row.eauser_title}</td>
                    <td>{$row.earesult}</td>
                    <td>{$index}
                        {if $row.ctime>$row.start}
                        <span class="colorRed duigou" title="此单申请时间在活动开始时间之后">补单</span>
                        {/if}
                    </td>
                    <td>
                        <a href="{:url('dataview',['id'=>$row.id])}" class="J_menuItem">{$data.sn}_{$row.sn}</a>
                        <a href="{:url('Commonti/decisionb')}?did={$row.id}"  class="J_menuItem"><span style="display: none;">决策信息</span><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a>
                    </td>
                    <td>{if $row.net_id}{$row.net_title}<a href="{:url('Commonti/netyj')}?did={$row.id}" class="J_menuItem"><span style="display: none;">网点决策依据</span><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a>{else}{$row.jxs_title}<a href="{:url('Commonti/jxsyj')}?aid={$data.id}" class="J_menuItem"><span style="display: none;">经销商决策信息</span><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true"></span></a>{/if}</td>
                    <td>从{:date('Y-m-d',$row.start)}至{:date('Y-m-d',$row.end)}</td>
                    <td>
                        {if $row.ydstart&&$row.ydend}
                        从{:date('Y-m-d',$row.ydstart)}至{:date('Y-m-d',$row.ydend)}
                        {/if}
                    </td>
                    <td>{:date('Y-m-d',$row.expCanTime)}</td>
                    <td>{$row.productlatval}{if $data.productlat==1}{elseif $data.productlat==2}{elseif $data.productlat==3}{elseif $data.productlat==4}{else}<a href="{:url('Commonti/productroi')}?did={$row.id}" class="J_menuItem"><span style="display: none;">ROI决策信息</span><span class="glyphicon glyphicon-zoom-in fangda" aria-hidden="true" style="display: inline-block;"></span></a>{/if}</td>
                    <td>{$row.feetype}</td>
                    <td>{$row.paymethod_title}{if $row.paymethod==13}<img src="__STATIC__/layout/img/car.png" alt="" class="car">{/if}</td>
                    <td>{$row.amount}</td>
                    <td>{if $row.isVAT==1}是{else}否{/if}</td>
                    <td>{$row.shuilv}%</td>
                    <td>{$row.hanshui}</td>
                    <td>{$row.fb_shijitourufeiyong}</td>
                    <td>{$row.hx_yihexiao}</td>
                    <td>{$row.totalExpectedSales}</td>
                    <td>{$row.yujifeiyonglv}%</td>
                    <td>{$row.fb_shijixiaoliang}</td>
                    <td>{$row.xiaoshoudachenglv}%</td>
                    <td>{$row.2srjizhun}</td>
                    <td>{$row.totalBenchmarkSales}</td>
                    <td>{$row.yujiroi}%</td>
                    <td>{$row.brief}</td>
                    <td>{$row.ydreason}</td>
                    <td>{$row.qxreason}</td>
                    <td>{$row.jrbm}</td>
                    <td>{$row.jrbm_puser_name}</td>
                    <td>{$row.jrbm_dp}</td>
                    <td>{$row.jrbm_dp_puser}</td>
                    <td>{if $row.payee==0}(经销商){$row.jxs_title}{else}(供应商){$row.gys_name}{/if}</td>
                </tr>
                {/volist}
                <tr class="trTotal1 font-bold text-right">
                    <td colspan="5">小计</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{$rr.st_amount}</td>
                    <td></td>
                    <td></td>
                    <td>{$rr.st_hanshui}</td>
                    <td>{$rr.st_shijitourufeiyong}</td>
                    <td>{$rr.st_yihexiao}</td>
                    <td>{$rr.st_yujixiaoliang}</td>
                    <td>{$rr.st_yujifeiyonglv}%</td>
                    <td>{$rr.st_shijixiaoliang}</td>
                    <td>{$rr.st_xiaoshoudachenglv}%</td>
                    <td>{$rr.st_2srjizhun}</td>
                    <td>{$rr.st_jizhunxiaoliang}</td>
                    <td>{$rr.st_yujiroi}%</td>
                    <td colspan="8"></td>
                </tr>
                {/volist}
            </tbody>
            <tfoot>
                <tr class="trTotal1 font-bold text-right">
                    <td colspan="5">合计</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td>{$data.amounts}</td>
                    <td></td>
                    <td></td>
                    <td>{$data.hanshui}</td>
                    <td>{$data.shijitourufeiyong}</td>
                    <td>{$data.yihexiao}</td>
                    <td>{$data.yujixiaoliang}</td>
                    <td>{$data.yujifeiyonglv}%</td>
                    <td>{$data.shijixiaoliang}</td>
                    <td>{$data.xiaoshoudachenglv}%</td>
                    <td>{$data.2srjizhun}</td>
                    <td>{$data.jizhunxiaoliang}</td>
                    <td>{$data.yujiroi}%</td>
                    <td colspan="8"></td>
                </tr>
            </tfoot>
        </table>
        <div class="contact-box">
            <p class="font-bold">
                本申请中包含{if $data.net_cnt}{$data.net_cnt}个网点，{/if}{if $data.brand_cnt}{$data.brand_cnt}个品牌，{/if}{if $data.category_cnt}{$data.category_cnt}个品类，{/if}{if $data.category_cnt}{$data.category_cnt}个品类，{/if}{if $data.series_cnt}{$data.series_cnt}个系列，{/if}{if $data.sku_cnt}{$data.sku_cnt}个sku，{/if}{if $data.product_cnt}{$data.product_cnt}个单品，{/if}{if $data.feetype_cnt}{$data.feetype_cnt}个三级费用科目，{/if}其中{volist name="fei" id="f"}{$f.title}:{$f.jine}元;{/volist};总预计费用:{$data.hanshui}元;总预计销量:{$data.yujixiaoliang}元;总预计费用率:{$data.yujifeiyonglv}%;总ROI:{$data.yujiroi}%;
            </p>
        </div>
        <table class="table table-bordered text-left bud_hei">
            <tr class="info">
                <th class="text-left font-bold">审批意见</th>
            </tr>
            {volist name="logs" id="l"}
          <tr>
              <td>{$l.USERNAME} 审批动作：{$l.MEMO}；审批意见：{if $l.COMMENTS}{$l.COMMENTS}{else/}无{/if}(审批时间：{$l.ACTIONTIME})</td>
          </tr>
          
          {/volist}
      </table>
    </form>
</div>

{if $data.status==7}
{if $data.status2==1}
<div class="SuccessImg font-bold">
    申报已异动
</div>
{elseif $data.status2==2}
<div class="applyImg font-bold">
    申报已取消
</div>
{else}
<div class="applyImg font-bold">
    申报已生效
</div>
{/if}
{elseif $data.status==10}
<div class="SuccessImg font-bold">
    费用已核销
</div>
{/if}
<!-- 全局js -->
{include file="Public/footer"}

<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/contabs_sub.js"></script>
</body>

</html>
